package 设计模式.代理模式.动态代理;



import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyLogProxyInvocationHandler implements InvocationHandler {

    private Object target;

    public MyLogProxyInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object o, Method method, Object[] args) throws Throwable {

        System.out.println("log is start");
        method.invoke(target,args);
        System.out.println("log is end");
        return null;


    }
}
